/* eslint-disable spaced-comment */
import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'

Vue.use(Vuex)

/* let defaultCity = '上海'
try {
  if (localStorage.city) {
    defaultCity = localStorage.city
  }
} catch (e) {} */
export default new Vuex.Store({
  /*state: {
     city: localStorage.city || '上海'  city值首先从localStorage.city中取 如果取不到为默认值 上海
    city: defaultCity
  },
    actions: {
    changeCity (ctx, city) {
      console.log(city)
      ctx.commit('changeCity', city)
    }
  },
  mutations: {
    changeCity (state, city) {
      state.city = city
      localStorage.city = city
      try {
        localStorage.city = city
      } catch (e) {}
    }
  }*/
  state: state,
  mutations: mutations
})
